<div class="auth-block">
  <div class="loading" *ngIf="loading"></div>
  <form class="form-horizontal" (ngSubmit)="onSubmit()" #form="ngForm">
    <div class="form-group form-title row">
      <h2>重置密码</h2>
    </div>

    <div class="form-group row" [class.has-error]="name.invalid && name.dirty">
      <label for="name" class="col-sm-3 control-label">姓名/公司名</label>
      <div class="col-sm-9">
        <input type="text" class="form-control" id="name" name="name" required
               [(ngModel)]="resetForm.name" #name="ngModel">
        <span [hidden]="name.valid || name.pristine" class="error-info">请填写姓名/公司名</span>
      </div>
    </div>

    <div class="form-group row" [class.has-error]="email.invalid && email.dirty">
      <label for="email" class="col-sm-3 control-label">邮箱</label>

      <div class="col-sm-9">
        <input type="email" class="form-control" id="email" name="email" required
               [(ngModel)]="resetForm.email" #email="ngModel">

        <span [hidden]="email.valid || email.pristine" class="error-info">请填写邮箱</span>
      </div>
    </div>

    <div class="form-group row" [class.has-error]="tel.invalid && tel.dirty">
      <label for="tel" class="col-sm-3 control-label">电话</label>

      <div class="col-sm-9">
        <input type="text" class="form-control" id="tel" name="tel" maxlength="11" required
               [(ngModel)]="resetForm.tel" #tel="ngModel">
        <span [hidden]="tel.valid || tel.pristine" class="error-info">请填写电话</span>
      </div>
    </div>

    <div class="row" *ngIf="errorMsg">
      <span class="error-info">{{errorMsg}}</span>
    </div>
    <div class="form-group row" *ngIf="newPass">
      <label for="tel" class="col-sm-3 control-label">新密码</label>
      <div class="col-sm-9">
        <span class="success-info" style="font-weight: bold; color: red; font-size: 20px">{{newPass}} ， 请用新密码登录！</span>
      </div>
    </div>

    <div class="form-group row">
      <div class="col-sm-offset-2  col-sm-10">
        <span class="register-label"><a routerLink="{{directToBase}}">返回登录</a></span>
      </div>
    </div>

    <div class="form-group row">
      <div class="col-sm-12">
        <button type="submit" class="btn btn-auth" [disabled]="!form.form.valid">提交</button>
      </div>
    </div>
  </form>
</div>
